using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;

namespace ns
{
    public class UIFirstWindow : UIWindow
    {
        public void Start()
        {
            UIEventListener.GetListener(
            transform.FindChildByName("1")).PointClick += On1Click; 
            UIEventListener.GetListener(
            transform.FindChildByName("2")).PointClick += On2Click; 
            UIEventListener.GetListener(
            transform.FindChildByName("3")).PointClick += On3Click;
            UIEventListener.GetListener(
            transform.FindChildByName("4")).PointClick += On4Click;
        }

        private void On4Click(PointerEventData evnetData)
        {
            SceneManager.LoadSceneAsync(4);
        }

        private void On3Click(PointerEventData evnetData)
        {
            SceneManager.LoadSceneAsync(3);
        }

        private void On2Click(PointerEventData evnetData)
        {
            SceneManager.LoadSceneAsync(2);
        }

        private void On1Click(PointerEventData evnetData)
        {
            SceneManager.LoadSceneAsync(1);
        }
    }
}

